import React, { Component } from 'react';
import head from '../../state/login_03.gif'
import pay from '../../state/待付款.png'
import huo from '../../state/已发货.png'
import huoed from '../../state/已付款.png'
import ping from '../../state/待评价.png'
import { RightOutlined } from '@ant-design/icons'
import { good_favlist } from '../../utils/api'
import './mine.scss'
class Mine extends Component {
    constructor(props) {
        super(props);
        this.state = {
            arr: []
        }
    }
    componentDidMount() {
        good_favlist({ userid: localStorage.getItem("userid") }).then((res) => {
            this.setState({
                arr: res.data.list
            })
        })
    }
    render() {
        return (
            <div className='mine'>
                <div className="mhead">
                    <div className="tou">
                        <img src={head} alt="" />
                        <p>嘿嘿</p>
                    </div>

                </div>
                <div className="all quan">
                    <div onClick={this.hand}>
                        <span>{this.state.arr.length}</span>
                        <span>收藏</span>
                    </div>
                    <div>
                        <span>0</span>
                        <span>积分</span>
                    </div><div>
                        <span>0</span>
                        <span>优惠券</span>
                    </div>
                </div>
                <div className="all order">
                    <div className="Oorder">
                        <h3>我的订单</h3>
                        <span>查看全部订单</span>
                    </div>
                    <div className="Ofont">
                        <div>
                            <img src={pay} alt="" />
                            <span>待付款</span>
                        </div>
                        <div>
                            <img src={huo} alt="" />
                            <span>待发货</span>
                        </div>
                        <div>
                            <img src={huoed} alt="" />
                            <span>已发货</span>
                        </div>
                        <div>
                            <img src={ping} alt="" />
                            <span>待评价</span>
                        </div>
                    </div>
                </div>
                <div className="all vip">
                    <span>会员中心</span>
                    {/* <span>右箭头</span> */}
                    <RightOutlined />
                </div>
                <div className="all jihe">
                    <div className="vip">
                        <span>领券中心</span>
                        <RightOutlined />
                    </div><div className="vip">
                        <span>我的评价</span>
                        <RightOutlined />
                    </div><div className="vip">
                        <span>收货地址</span>
                        <RightOutlined />
                    </div><div className="vip">
                        <span>我的客服</span>
                        <RightOutlined />
                    </div>
                </div>
            </div>
        );
    }
    hand = () => {
        this.props.history.push('/favlist')
    }
}

export default Mine;